/*
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-03-22 12:12:49
 * @LastEditTime: 2023-04-18 17:54:33
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 侧边栏导航样式
 * @FilePath: \vue3-element-plus-web\src\styles\sidebar.scss
 * Copyright 版权声明
 */
#app {
  // 主体区域
  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: $menuWidth;
    position: relative;
  }
  // 侧边栏
  .sidebar-container {
    transition: width 0.28s;
    width: $menuWidth !important;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    background-color: $menuBg;
    background: -moz-linear-gradient(top, $menuBg 10%, $menuBgGradual 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(10%,$menuBg), color-stop(100%,$menuBgGradual));
    background: -webkit-linear-gradient(top, $menuBg 10%,$menuBgGradual 100%);
    background: -o-linear-gradient(top, $menuBg 10%,$menuBgGradual 100%);
    background: -ms-linear-gradient(top, $menuBg 10%,$menuBgGradual 100%);
    background: linear-gradient(to bottom, $menuBg 10%,$menuBgGradual 100%);
    // 产品logo
    .pro-log{
      width: $menuWidth;
      height: 50px;
      position: fixed;
      left: 0;
      top: 0;
      z-index: 3;
      font-size: 16px;
      font-weight: bold;
      color: #fff;
      text-align: center;
      line-height: 50px;
      border-bottom: 1px solid $menuTopBorderBottomColor;
      background-color: $menuTopBorderBottomColor;
      box-sizing: border-box;
      padding: 10px 20px;
      caret-color: transparent;
      img{
        width: 100%;
        cursor: pointer;
      }
    }
    .pro-log.small{
      display: none;
    }
    .pro-log ~ .el-menu {
      height: calc(100% - 50px);
      position: relative;
      top: 50px;
      z-index: 1;
    }
    //reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }
    .scrollbar-wrapper {
      // height: calc(100% + 15px);
      .el-scrollbar__view {
        height: 100%;
      }
    }
    .is-horizontal {
      display: none;
    }
    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }
    .svg-icon {
      // margin-right: 12px;
    }
    .el-menu {
      border: none;
      height: 100%;
      // height: calc(100% - 60px);
      width: 100% !important;
    }
    .el-sub-menu__title i{
      right: 10px;
      color: #fff;
    }
    .el-sub-menu__title .menu-icon{
      color: $menuItemIconColor;
    }
  }
  .sidebar-container .el-sub-menu .el-menu-item.is-active,
  .sidebar-container .el-menu-item.is-active{
    background-color: $menuItemActiveBg !important;
    border-left: $menuItemActiveBorderWidth solid $menuItemActiveBorderColor;
  }
  .hideSidebar {
    .main-container {
      margin-left: 36px;
    }
    .sidebar-container{
      width: 36px !important;
      .pro-log {
        width: 40px !important;
        overflow: hidden;
        margin-left: -5px;
        display: none;
      }
      .pro-log.small{
        display: block;
        padding: 10px 3px;
        margin-left: 0;
        width: 36px !important;
      }
      .submenu-title-noDropdown {
        padding-left: 7px !important;
        position: relative;
        .el-tooltip {
          padding: 0 7px !important;
        }
      }
      .el-sub-menu {
        overflow: hidden;
        &>.el-sub-menu__title {
          padding-left: 7px !important;
          .el-sub-menu__icon-arrow {
            display: none;
          }
        }
      }
      .el-menu--collapse {
        .el-sub-menu {
          &>.el-sub-menu__title {
            &>span {
              height: 0;
              width: 0;
              overflow: hidden;
              visibility: hidden;
              display: inline-block;
            }
          }
        }
      }
    }
  }

  .sidebar-container .el-sub-menu__title,
  .sidebar-container .el-menu-item{
    padding: 0 10px !important;
    &:hover{
      background-color: $menuItemActiveBg !important;
    }
    .menu-icon{
      position: relative;
      left:0;
      color: $menuItemIconColor;
    }
  }
  .sidebar-container .el-sub-menu .el-menu-item,
  .sidebar-container .nest-menu .el-sub-menu>.el-sub-menu__title{
    padding-left: 20px !important;
  }
  .sidebar-container .nest-menu .el-sub-menu>.el-sub-menu__title,
  .sidebar-container .el-sub-menu .el-menu-item {
    min-width: $menuWidth !important;
    background-color: $subMenuBg !important;
    &:hover {
      background-color: $menuItemActiveBg !important;
    }
  }
  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $menuWidth !important;
  }

  //适配移动端
  .mobile {
    .main-container {
      margin-left: 0px;
    }
    .sidebar-container {
      transition: transform .28s;
      width: $menuWidth !important;
    }
    &.hideSidebar {
      .sidebar-container {
        transition-duration: 0.3s;
        transform: translate3d(-$menuWidth, 0, 0);
      }
    }
  }
  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// 菜单折叠后样式
.el-menu--vertical{
  .el-menu--popup{
    background: $menuBg !important;
    .el-menu-item:focus, .el-menu-item:hover{
      background: $menuItemActiveBg !important;
    }
  }
}
